import { defineStore } from 'pinia'
import { ref } from 'vue'


//使用pinia存储用户token信息
export const useUserStore = defineStore(
  'token',
  () => {
    const token = ref('')
    const rtoken = ref('')
    const setToken = (t) => {
      token.value = t
    }
    const setRtoken = (t) => {
      rtoken.value = t
    }
    return { token, setToken, rtoken, setRtoken }
  },
  {
    persist: true
  }
)
